const Sequelize = require('sequelize');

const sequelize = require('../lib/sequelize')

const Article = sequelize.define('t_article', {
    id: {
        type: Sequelize.INTEGER,
        autoIncrement: true,
        primaryKey: true
    },
    user_id: Sequelize.INTEGER,
    type_id: Sequelize.INTEGER,
    title: Sequelize.STRING,
    type: Sequelize.INTEGER, //1、图文 2、纯文字
    content: Sequelize.STRING,
    comment: Sequelize.STRING,
    view: {
        type: Sequelize.INTEGER,
        defaultValue: 0
    },
    del: {
        type: Sequelize.INTEGER,
        defaultValue: 0
    }
});

// Article.sync({force: true})

module.exports = Article